package com.ydd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ydd.entity.SysMenu;
import com.ydd.vo.SysmenuVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * @Description TODO
 * @Author fang
 * @Date 2023-05-29 16:06
 */
@Mapper
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    /**
     * 根据父级id查询下级菜单
     * @param pid
     * @return
     */
    List<SysmenuVO> getByPid(Long pid);

    /**
     *根据id删除菜单，逻辑删除
     * @param id
     */
    @Update("update sys_menu set del_flag=1 where del_flag=0 and id=#{id}")
    void deleteMenuById(Integer id);

    /**
     * 根据id查询菜单
     * @param id
     * @return
     */
    //@Select("select * from sys_menu where id=#{id} and del_flag=0")
    SysmenuVO getMenuById(Integer id);

    /**
     * 菜单修改
     * @param sysMenu
     */
    //void updateMenu(SysMenu sysMenu);

    /**
     * AdminIndexService-profile
     * @param conditionMap
     * @return
     */
    List<SysMenu> getByCondition(Map<String, Object> conditionMap);

    /**
     * 根据id查询菜单返回VO类型
     * @param id
     * @return
     */
    SysmenuVO getMenuByIdVO(String id);

    //void insertMenu(SysMenu sysMenu);
}
